package com.example.order.dao.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("order_info")
public class OrderInfo {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField(value = "order_id")
    private Long orderId;
    @TableField(value = "product_id")
    private Long productId;
    private Long quantity;
    private Long cost;
    @TableLogic
    private boolean deleted;
}
//CREATE TABLE `order_info` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
//    `order_id` BIGINT NOT NULL COMMENT '订单ID',
//    `product_id` BIGINT NOT NULL COMMENT '商品ID',
//    `quantity` BIGINT NOT NULL DEFAULT 0 COMMENT '商品数量',
//    `cost` BIGINT NOT NULL COMMENT '订单金额(单位：分)',
//    `deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除标记',
//    PRIMARY KEY (`id`),
//    INDEX `idx_order` (`order_id`),
//    INDEX `idx_product` (`product_id`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单明细表';

